Formatted code to style guides, finalise changes