public void returnBook(String title) {

            // initialize variables
            Book b = null;
            _title = title;
 
            // get number of titles available in the queue
            for (int i = 0; i < bookQueue.size(); i++) {
                if (_title.equalsIgnoreCase(bookQueue.get(i).getbookTitle()))
                    booksInQueue++;
                    //System.out.println(title);
            }
            
            lock.lock();
            try {
                System.out.println(booksInQueue);
                if (_availableToBorrow > booksInQueue) {
                    System.out.println("queue is full");
                    notFull.await();
                }
                
                for (int i = 0; i < bookQueue.size(); i++) {
                    if (_title.equalsIgnoreCase(bookQueue.get(i).getbookTitle()) &&
                            _availableToBorrow <= bookQueue.get(i).getCopiesAvailable()) {
                        b = bookQueue.get(i);
                        bookQueue.offer(b); // add object to queue
                        notEmpty.signal();
                        break;
                }                        
            } 
            }catch (InterruptedException ex) {
                ex.printStackTrace();
            } finally {
                lock.unlock();
            }
        }