Removed usage of error function