setting up datastructures for inheritance algorithm