added some modifications
fixed conflicts