initial version

ported from scassh