Improved formatting and added additional comments