Not sure why my array is not allowed to use a function (OOP)

Easy. The class bracket } comes in too early.

It is before the method change but must be after the entire method change()