Working LPI algorithm