A cache aware algorithm. Checks are wonky and broken currently