improved length pointer