added sleep times, state changes and formatted