add two helper functions -root paths and derived paths to get the roots and derived