added iheritance; refactored returns and blocks