State updates

Updated logic for the state update file.