misc bugfixes
added statistics
Added initial state
fixed various bugs in scaffolding