add the /state stuff and move more things around