adding is_sub_cursor flag and tweaking windowing algorithm