add comments on complexity