Added commets about time complexity