simple JavaScript function