Corrected seconds and simplified code