Clean up formatting and fix comments