more algorithm work!