Corrected step logic