syntax fixes and slimed down some code