implemented singletons. added insstance and subtype testing.