implemented inheritance.
events and model integration still remaining.