added tests for functions
added the check for the structure of input hash