outline of what the algorithm should do.