added comment explaining cursor calculations