Adding paramgt function needed by checkgrad2