Bunch of changes. Split original in to multiple files. Added time to new state.