Changes to cursor detection