reorg
stub out c implementation
c version doesn't really work yet