reverse mistaken code