refactored code, added html and css