Source: https://www.cse.wustl.edu/~jain/cis777-98/ftp/g_fwmt.pdf