C# code for Project 3