algorithm test finally