Use path libary to determine base name