fixed styling and cleaned up some code