rewrote initial part
rewrote ff replan
fix conflict