added functions to zzz.R