Initial Solution and some Pseudocode