added r3.c and .h

getting us started on r3.