Corrected the Next and last operations