initial version of allocate_block