trying to figure out r