added documentation to get_features
Refactored get_features to be more optimzed and easier to read