fix issue #470, add get_lp function