Refactored code to be neater. Added CSS to improve styling.