pass $this correctly to functions, mostly