Code formatting changes from Phil Daintree