initial pseudocode added