fixing formatting and adding comments