Added a printerr func to print to stderr