updated comments, formatting and standardised capitalisation