added a class to divide data into training and testing sets