comments and some error handling.