Adding heritage, attribute and correcting some bugs