Work on #258

This is a bunch of work that should go toward #258. It is not finished yet but here we go