calculate rvals up front