custom type function