Added some pseudo code.