More of chapter 4 in Venkat S's book