Added algorithm
fixed conflicts