changed all 'this' to 'self'