updated VF-part of computation to be in line with the rules. fixed my own stupid bugs.