Creating listFiles function