edited code after one failed run