finished allocator implementation