add loop snippet