added --cleanup option