changed arrays to read/write in VecFun (let your member functions handle the read/write protection)