Right simple algorithms in C#.