correct calculation of night shifts