reformatted, removed/added comments