Modified for new implicit method with swoitches