Updated generate_certificates