modifying greap -g and -ng behaviour to be chained with AND