You are using a value class, not a handle class. You change h.data inside the chg function, and that revised object gets returnedas a value. But you do not assign the results back over top of h; you just have semi-colon on the end of the line, so the result of the chg() function is not even displayed.
If you want to be able to call functions like that and have the properties changed without having to assign over-top of the existing object, then you need to switch to using a handle class.