changed to int arrays from double linked list
removed newline in path printout.