update docs
move state to different file