Createt and tested funcionts