private void calculateRanges() {
        roomsMin = 1000000;
        roomsMax = 0;
        areaMin = 1000000;
        areaMax = 0;
        int a = 1, r = 0;
        for (int i = 0; i < dwellings.size(); i++) {
            if (dwellings.get(a).getArea() < areaMin) {
                areaMin = dwellings.get(a).getArea();
            }
            if (dwellings.get(a).getArea() > areaMax) {
                areaMax = dwellings.get(a).getArea();
            }

            if (dwellings.get(r).getRooms() < roomsMin) {
                roomsMin = dwellings.get(r).getRooms();
            }
            if (dwellings.get(r).getRooms() > roomsMax) {
                roomsMax = dwellings.get(r).getRooms();
            }
            if (r <= dwellings.size() - 6) {
                r += 3;
            }
            if (a <= dwellings.size() - 5) {
                a += 3;
            }
        }
    }