made inheritance possible and added to_hash