improved readme and added error checking