replacing the correct section of code