reworked to seconds
added comments
not fixed, indentation