some common algorithms