trying to figure out the logic GIF