algorithm okay, fixed either word contains other