adding broken generate code so James can look at it