refactored addFeatures from library