Preliminary pseudocode
More pseudocode