added comments and missing arguments