Add allocate method