added formatting and extra comments