FIXED: Major update. Fixed bugs and did some cleanup.