bugfix in BCPNN, sweep_ctx_dim abstract, beginning to clean up