modified: ap func.