added data.frame splitting and saving functions