stages hbshci/fhi#165 and first 7 pgs from hbshci/fhi#166