Added error function

Useful for debugging. This function easily allows the dev to print
out an error message to stderr.