implemented test cases and php documentation for all functions