testing definition, function made
works with given test cases