algorithm view 1