*** fixed small bug when calculating inheritance