added some control stuff
fixed merge conflicts