added code to handle more files