Transcript of non refactored c# version