more exception handling and comments