algorithm testing using Visual C#