split code across files; finished general, events, window