some basic function for global use