adding in some comments and making the errors go to std error