adding cmaneu's c# contribution