@Override
    public int compareTo(VectorTimeStamp ts) {
        boolean beforeFlag = false;
        boolean afterFlag = false;

        // For vector time stamp, we need to compare corresponding value one by one
        for(Entry<String, AtomicInteger> e : localTS.entrySet()) {
            int local = e.getValue().get();
            int remote = ts.getTimeStamp().get(e.getKey()).get();

            if(local < remote) {
                beforeFlag = true;
            }
            else if(local > remote){
                afterFlag = true;
            }
        }

        if(beforeFlag == true && afterFlag == false) {
            return -1;
        }
        else if(beforeFlag == false && afterFlag == true) {
            return 1;
        }
        else {
            return 0;
        }
    }