allow passing in of length