code for dividing the datatset