cleaned up code
reduced a number of pages