Add new functions and sample unittest