Add complexity analysis and small corrections