Changed the update rule for R and N, it actually sums up the averages now instead of taking the last number