implemented binary.alloc()