Solution structure in place -partial pseudo code.  Awaiting implementation