Fixed paging error with htrim
Updated start, end values in htrim

Previous version works but it may give wrong results. Bytes might be lost with previous version.