Adds sleep time; minor changes to calculation of wake times.