comment everything and split some code into separate files