Some random generation stuff for testing sources