An error is now thrown on the first difference

Added functionality so that an error is thrown when the first difference is found.