private static Number appropriateParseFor(String text, Class<? extends Number> numberFormat) throws NumberFormatException {
        if(numberFormat == Long.class){
            return Long.parseLong(text);
        }
        else if(numberFormat == Integer.class){
            return Integer.parseInt(text);
        }
        else if(numberFormat == Double.class){
            return Double.parseDouble(text);
        }
        else if(numberFormat == Float.class){
            return Float.parseFloat(text);
        }
        else{
            throw new RuntimeException("cant figure out appropriate number format");
        }
    }