removed seperate files from main. This should be encapsulated in a class.