added statistics
Added initial state
fixed various bugs in scaffolding