RF: divide into smaller subfunctions
NF+TST: allow number of features and add unit test to illustrate behaviour