add more tests and improve words detection