Use Python slicing operator instead of offset loop.