complete base function, add sample test case