updated functions file