new function to calculate r and m by Buxton