changed it to use the glue code