Implement and test add to path function