update to testv.cpp, including Damian and Alex's improvement