Planning and thinking