Added cursor method for walking through database