switched to generator expressions
cleaned up FK tree code