lots of changes, now runnable