split function to save tape