Added superclass pointer and much refactoring