removed self.X as default arguments for functions, as this was giving errors.
addition of reminder to compute an offset so the controller works correctly.