working offline recon for partitioning code, but needs to be cleaned up a bit more