some improvements and algorithms updating