added error messages, tests passing