added cursor code