additions from @markchadwick