update code: many changes see changelog