TODO: write a statement and optimize code with Kostya