changed alloc_case param to int