def sizecmp(dbent1, dbent2):
    """
    Comparison function for (pdbid,dbtablist)
    tuples used to sort database by size
    """
    tab1 = dbent1[1][0]
    tab2 = dbent2[1][0]
    if len(tab1) < len(tab2):
        return -1
    elif len(tab1) > len(tab2):
        return 1
    else:
        return 0