Added README file and improved error handling