tweaked R and dR calcs. still not working