rewrite personnel function