more error handling, comments