changed the renameFiles method to take filter argument