smarter way of getting filenames. nice !!!