added sort and filter options to readFiles method