add pseudo-code for ideas