further implementation of stackgl