changed templating, tweaked R triggering