3rd task also done with tests(now I can sleep :) )