copy some from crowbar in diksam.y