implement some useful algorithms