private void give(Command command) {
        // check whether command has argument.
        if (!command.hasSecondWord()) {
            System.out.println("Give whom?\n");
            return;
        }
        // identify the name part in the rest and find receiver.
        String rest = command.getSecondWord();
        if (checkWhoIsNear() == null) {
            System.out.println("There doesn't seem to be any such person in here.\n");
            return;
        }
        if (!rest.toLowerCase().contains(checkWhoIsNear().getName().toLowerCase())) {
            System.out.println("There doesn't seem to be any such person in here.\n");
            return;
        }
        Character receiver = checkWhoIsNear();
        String receiverName = receiver.getName();
        // identify the item part of the command and find the item.
        String itemName = rest.substring(receiverName.length() + 1);
        if (items.get(itemName) == null) {
            System.out.println("Give what?\n");
            return;
        }
        Item item = player.getItem(itemName);
        // check that item is in inventory and then that it's not flagged as quest item.
        if (item == null) {
            System.out.println("There is no such item in your inventory.\n");
            return;
        }

        // checks whether any quest has progressed (and that it hasn't already done so previously).
        if (receiverName.equals("Hrangst Jaltibrond") && item.getName() == "Bread loaf" && !quests.get("quest1").getPart(1)) {
            quests.get("quest1").completedPart(1);
            if (!quests.get("quest1").getPart(2)) {
                System.out.println(receiverName + ": Thank you, I am absolutely starving. Could you please get me out of here?\n");
                receiver.addDialogue("salutations", "Hello, friend. Could you please get me out of here?");
            } else {
                quests.get("quest1").completedPart(0);
                System.out.println(receiverName + ": Thank you so much for all your help, kind soul. I won't bother you anymore. Here, take this key so you may continue your journey. I wish you the best of fortune. Now, I must go.\nThe old man didn't smile, but as he walked away, you could see the gratefulness in his eyes. You wonder how such a scrawny figure might fare in such a place, but before you had a time to reply he was gone.\n");
                receiver.removeItem(items.get("sturdy key"));
                player.addItem(items.get("sturdy key"));
                receiver.removeDialogue("salutations");
                receiver.addDialogue("salutations", "Hello, friend. I appreciate all your help.");
                receiver.removeDialogue("greetingsNear");
                receiver.addDialogue("greetingsNear", "You hear the old man moving around in the adjoining room.");
                receiver.removeDialogue("greetingsSame");
                receiver.addDialogue("greetingsSame", "The scrawny old figure you rescued earlier seems to wander around aimlessly. His ambitions seem a great mystery. Why is he not trying to escape this place?");
                receiver.addLocationHistory(rooms.get("hallwayB1"));
                receiver.setMoveable(true);
            }
        } else if (item.getQuestItem()) {
            System.out.println("You figure you might want to hold on to this.\n");
            return;
        }
        // gives the item to the character and removes it from the player.
        receiver.addItem(item);
        player.removeItem(item);
        return;
    }