Start implementing lpi algo