Changed prim generator to deal with both types