some basic functions for global use