fix sloppy copypasta

range needs to use newLength for the length