add allocate method; add additional testing