private int allocBlock(int size)
    {
        //debugPrintln("Entering allocBlock with size: " + size);
        //Keep track of how much free space we find and the best block we've found so far
        int totalFree = 0;
        MemBlock bestBlock = null;
        
        for(MemBlock block : m_freeList)
        {
            //Best case: We've found a free block that's just the right size
            if (block.getSize() == size)
            {
                m_freeList.remove(block);
                return block.getAddr();
            }
            //Next case: We find a bigger block that has enough space to hold the process
            // Keep track of it but don't make a decision in case we hit the Best Case later.
            else if (block.getSize() > size)
                bestBlock = block;
            
            totalFree += block.getSize();
        }
        
        //If we found a bigger block, time to use it.
        if (bestBlock != null)
        {
            int address = bestBlock.getAddr();
            
            //Make the changes to the block in the free list
            int index = m_freeList.indexOf(bestBlock);
            bestBlock.m_addr += size;
            bestBlock.m_size -= size;
            m_freeList.set(index, bestBlock);
            
            return address;
        }
        
        //Otherwise we've run out of memory
        if (totalFree < size)
            return -1;
        
        //Clean up and try again
        defragMemory();
        
        return allocBlock(size);
    }//allocBlock