added handling of "this" reference. Can't say I'm happy with my approach, but it works for now.