add functional csharp solution