fixed formatting, added comments