clean up handling of node hashes
use {} and [] instead of Hash.new and Array.new