overhauled lagrange prediction for accuracy and made it work properly in phase 2/3