borrow some things from pygg2 i might use later