Modified code. Before code review.