A* path finding in Ruby