public Archive findStartMatchArchive(String consolFun, long startTime, long resolution) throws IOException {
        long arcStep, diff;
        int fallBackIndex = 0;
        int arcIndex = -1;
        long minDiff = Long.MAX_VALUE;
        long fallBackDiff = Long.MAX_VALUE;

        for (int i = 0; i < archives.length; i++) {
            if (archives[i].getConsolFun().toString().equals(consolFun)) {
                arcStep = archives[i].getArcStep();
                diff = Math.abs(resolution - arcStep);

                // Now compare start time, see if this archive encompasses the requested interval
                if (startTime >= archives[i].getStartTime()) {
                    if (diff == 0)                // Best possible match either way
                    {
                        return archives[i];
                    }
                    else if (diff < minDiff) {
                        minDiff = diff;
                        arcIndex = i;
                    }
                }
                else if (diff < fallBackDiff) {
                    fallBackDiff = diff;
                    fallBackIndex = i;
                }
            }
        }

        return (arcIndex >= 0 ? archives[arcIndex] : archives[fallBackIndex]);
    }