fixed conflicts and unused functions