medium on part 2 of generate