Can't find the error...

Can't find the error...

Here is my code following a tutorial on the forums about mapping variables. I have followed line through line of the code and am getting an error with the "void" function. In the script editor, the error reads: " Encountered "void" at line 17, column 1.,
Was expecting one of:
"if" ... "for" ... "delete" ... "insert" ...
"inserthtml" ..."share" ..."unshare" ..."%>" ...

fields=getFieldNames();
form_map=map();
for each field in fields
{
    value=getFieldValue(field);
    form_map.put(field,value);
}

void myMapFunction(list fields, map form_map)
{
    for each field in fields
    {
        if(!field.contains("client_"))
        {
            form_map.remove(field);
        }
    }

    request_map = map();
    request_map.put("form_map", form_map);
    xml_response = postUrl("http://RESTresourceExample.com", request_map, false);
    response = xml_response.get("responseText");
    response = response.executeXPath("/response/result/message/text()");
    return response;

}

thisapp.myMapFunction(fields, form_map);


Help solving this issue would be very much appreciated. Thank you.