started rework on sleep/cont func