Fixed example 4 - the function was working with a reference to y, so in each step of the loop y was modified alongside y_new which influenced the result of the following steps of the loop. We just need to create a new empty array y_new with zeros and fill it with values in the loop.