added fetch_switching_cycles function in spec