Initial implementation, reusing bites from gcmurphy too.