added comments for readability
still a hack.
some style updates to make it work better across all pages.