porting words example / some refactoring / bug fixes