originally ported from bhoma, not used anywhere