improved 1, bug in repeated words