pruning: the program runs fine now, but the results are unsatisfactory, there must be some kind of mistake in calculation of values