Added code from NingAnalyser repository