Improve boundary detection at bottom edge of the screen