changed from prototype references to plain old 'this'