Adding split method to the homework