sliding logic edge case