Refactor some of the poetry problem, have not been able to figure out one of the cases though