Added pseudocode to try to figure out exactly what we need to do.