add reference code from gv and libspectre to be used latter