prototype of LU algorithm