Fixed test file, cleaned up a little bit prepareNodesArray method, added onEnd method