Moving temp float: left to JS; some code formatting