complete code for adding features and testing

format of datai and dataf as indicated in example.py