cleaned up code to meet style standards