Add support for r3 instances

This is the exact same as #53 except into the v2 branch.