corrects second section of code