Changed tbbay to functions