cleaned up code, indentation, organizing etc.