Algorithm application and tests