turns out my corner cases weren't correct. Should be fine now.