Added parameters to cursor function