automatically fill in equation and set variables