assign method added which combines set() and loop() methods