cleaned up some code
fixed conflicts