add function to split data into training and test sets