added -r option for tag filtering