First drafts of code refactorization, better collision handling, adding returnStrType(), first draft of random events