second version: auto and manual