Redesign fileOfSize function