fork from https://github.com/veer66/wordcut