added 2 algorithm