docs update and unit test pseudo code