Sept 22 Major fixes to nbv without virtual targets, see lab book for details
Reorganised function order and commmented