complete algorithm
algorithm with vision2