Added split function, but not working entirely yet