Typo...
Fixed bugs
debugging...
locatime -> localtime
Tidying up