some comments and exception handling