numerous bugfixes, added 2 glitches, and cleaned up structure of script