formatting to hours and/or minutes
Modified, commented and fixed