restructing javascript, everything's mostly broken now. Added CSS styling and moved some HTML around