collecting useful functions (I hope)