fixes to allow cell assembly run
major refactoring and bug fixes