Updated for multiple variables