refactored code and finished styling