fixed start of idle time detection bug
formatting tweaks