added traces to see what is going on

put in system.out.println statements to see what is going on in
algorithm