Add needed variables to functions