Retakes logic implemented