added initial code & pseudocode