Pla 1641b

wait for QA
I have 2 observations here
1) A docblock would be nice
2) What's the size of data passed? If it's not huge, maybe it'd be more predictable to approach this functionally and return new arrays instead of modifying the ones passed as arguments?