Almost cleaned up version.
Fixed bug with VNS repick.