Solving name errors
modifications