I think this is the write-up I pulled these functions from: https://kitchingroup.cheme.cmu.edu/blog/2016/10/29/Sending-h...