My solution of this task