calculates hours