added the experiment framework, fixed tests and bugs