implements getwords