added goldilocks algorithms