implementing a path resolving function