fixed library to avoid divide by a func argument