add comments and fix