fixed test.java and added node counter