public void remove(String[] args) {

        CalendarData data = new CalendarData("cal-data.cal");
        CalendarListFormatter formatter = new CalendarListFormatter();
        Scanner read = new Scanner(System.in);
        GregorianCalendar beginDate = null;
        GregorianCalendar endDate = null;
        String[] dateBits;
        String date;

        boolean dateArg = false;
        while (true) { // Loop until we get valid input.
            if (args.length <= 1) {
                System.out.println("Enter date (yyyy-mm-dd): ");
                dateBits = read.nextLine().split("-");
            }
            else {
                dateBits = args[1].split("-");
                dateArg = true;
            }

            if (dateBits.length != 3) {
                System.out.println("Please enter a valid date.");
                if (dateArg) {
                    System.exit(1);
                }
                continue;
            }

            try {
                beginDate = new GregorianCalendar(Integer.parseInt(dateBits[0]),
                                                  Integer.parseInt(dateBits[1]) - 1,
                                                  Integer.parseInt(dateBits[2]));
                endDate = new GregorianCalendar(Integer.parseInt(dateBits[0]),
                                                Integer.parseInt(dateBits[1]) - 1,
                                                Integer.parseInt(dateBits[2]));
                break;
            }
            catch (Exception e) {
                System.out.println("Please enter a valid date.");
                if (dateArg) {
                    System.exit(1);
                }
                continue;
            }
        }

        formatter.setDateRange(beginDate, endDate);
        formatter.setNumberEvents(true);
        formatter.setShowDescription(true);

        String output = formatter.format(data);
        System.out.println(output);

        int eventNum = -1;
        while (true) {
            System.out.println("Event to remove: ");
            eventNum = 0;
            try {
                eventNum = Integer.parseInt(read.nextLine()) - 1;
                data.removeEvent((Event) data.eventsOnDate(new GregorianCalendar(Integer.parseInt(dateBits[0]),
                    Integer.parseInt(dateBits[1]) - 1,
                    Integer.parseInt(dateBits[2]))).toArray()[eventNum]);
                break;
            }
            catch (Exception e) {
                System.err.println("Please select a valid event.");
                continue;
            }
        }

        data.writeDataToFile("cal-data.cal");
        read.close();
    }