Modify visitsController gcalgorithm( )