Adding functions for path exploration
Importing solution for p18