Transitioning towards 100% renewables and the role of system flexibility