moved some things around an a lot of fixes