word selecting algortm inproovment