Andy : reformatted rest of js code.