changed the code structure back to one file. now ready to time and parallelize