Tests updated and now the method works for any number of variables