fixed problem. boundary condition was wrong. change form < to <=. add comment. recovery is too complex