added a function to split string