define protocol functions