lps non recursion version

lps non recursion version