Updated for more variables