Added tests. 6_2 optimization