Refactored again to specify the -r option explicitly.