Adding poly* functions and gradient support