added helper function to split files into batches
added specs for previous commit