updating Allocate and adding AllocateTest