modify separateword method