public int compareVersion(String version1, String version2) {
        String[] v1 = version1.split("\\.");
        String[] v2 = version2.split("\\.");
        int sectionV1 = Integer.parseInt(v1[0]);
        int sectionV2 = Integer.parseInt(v2[0]);
        int section = 1;

        if(sectionV1 < sectionV2){
            return -1;
        }else if(sectionV1 > sectionV2){
            return 1;
        }else{
            while(sectionV1 == sectionV2){
                sectionV1 = v1.length > section ? Integer.parseInt(v1[section]) : 0;
                sectionV2 = v2.length > section ? Integer.parseInt(v2[section]) : 0;
                section++;
                if(sectionV1 < sectionV2){
                    return -1;
                }else if(sectionV1 > sectionV2){
                    return 1;
                }else{
                    if(v1.length <= section && v2.length <= section) return 0;
                }
            }
            return 0;
        }
    }