added comments and exception