plan algorithm improved. 5.6.3