Add new function

please check in main function, thanks!