Got rid of globals, made almost all variables local and removed CAPITALIZATION. Major update