Refactored test_hv script to store data