evaluate -r earlier

this way we can use -r and -x together
remove debug code