private int[] ConvertTextToFrequencies() { int totalLines = InputBox.LineCount; int[] returnArray = new int[totalLines]; for (int lineNumber = 0; lineNumber < totalLines; ++lineNumber) { string line = InputBox.GetLineText(lineNumber); int number = 0; if (Int32.TryParse(line, out number)) { returnArray[lineNumber] = number; } } return(returnArray); }