use local vars for the functions