add comments and fix formats