some basic algorithms that are often seen