algorithms version-4