made some significant changes to the algorithms of the VplusVcth function and did some debugging

not completed yet!
update