adopt latest gemgem; hope this is easier to understand