added cursor object
added some comments