cursor function and test
better add method