Broke generator out to its own file. Added number of elements option