Finish implementation of poem generation code.