My code isn't running as anticipated - C#