add algorithm for word transformation algorithm