Changed all print outputs to stderr to be compatible with python output in shell