Updated some formatting and ordering of code.