fixed bugs; added command line option for pruning;