Creating paths using dynamic memory, working on fixing pqueue