public static int lenghtUnitStringToIndex(String unit) {
        switch (unit) {
            case "m":
                return 0;
            case "ft":
                return 1;
            case "mm": 
                return 2;
            case "cm":
                return 3;
            case "km":
                return 4;
            case "mi":
                return 5;
            case "in":
                return 6;
            default:
                return 0;
        }
    }