function for word/* swapping added