added code to determine upper limit on rbf sum