A few data coding updates

CODES CLEANER THIS WAY.  Really.
Just a few R chagnes.