update code

fixed conflicts, seem all fine