Basic function finished and test cases passed