Simplified code and got rid of a couple of files.