Added some styling and tidied up code (of course).