Update gcAlgorithm() in the VisitsController