finish separating responsibilities
more compatibility with Node
not working A*, needs major debugging