separated matts code into the two scripted files