Improvements, added error handling, updated README.