add an algorihtm and modify the lib Dec 9th