Run length calc improved.
Reduced malloc calls.