cgi implementation