Code for Number Generation by Type

Seems a bit more tidy