I need help with cursor logic - C#