algorithm 166 GIFs