get rid of the last String, add filter && flags to listdir/listfiles that allow to limit what's listed