added --auto option