now gets time in seconds
fixing bugs