planning added, optimized