new machanism almost done, merge to master first.