1. renamed some variables;
2. change the NameError to StandardError;