public byte remove(int ConsumerID, int step ){
    byte item;

    full.P();
    mutex.P( );
 
    //remove an item from the buffer
    --count;
    item = buffer[front];
    fcopy = front;
    front = (front+1)%buffer_size;

    if(count == 0)
      System.out.println("Consumer consumed " + (char)item + " buffer empty");
    else
      System.out.println("Consumer "+ConsumerID+" removes message " +(char)item+" as step "+step+" from slot " + fcopy);    
 
    mutex.V( );
    empty.V( );

    return item;  
  }