A cleaned up version of BoG for the repo.