updated the code so that RV data can now by used