general functions