Updated generate_certificates according to feedback