Fixed styling, improved some code a little