switch to lib func