embarassing use of global functions