edited tests for error handling and added tests for result and iteration