rewrite the glwrapper