Most of the logic is done. Remaining work detailed in README