def get_int(val):
    """Attempts to convert the string given into the correct integer"""
    if val.isdigit():
        return int(val)
    elif val.endswith('h'):
        return int(val[:-1], 16)
    elif val.endswith('o'):
        return int(val[:-1], 8)
    elif val.endswith('b'):
        return int(val[:-1], 2)
