beginnings of the filename lookup - havent debugged well enough yet