re-format and add comments