fixes to allocator
change naming convention
add more error checking to allocator