Pulled the find in buffer logic into it's own function and setup the sliding window.