better setting of variables