subtract one from length