simple a-start pathfinding in ruby