Moved things around and started adding control functions