This is my solution for C#