last version with 7 states - timestamp added