#274 Improved code formatting and comments