make changes suggested by @ramnathv in line notes; use basename most important