isCapture algorithm works, clearCaptured encountering a werid bug, leaving the function far too early