fixed minor bugs, added full state
fixed bugs