gc - adding solution and various path-solving functions.