General codes for certain functions