Made a lot of changes to the overall algorithm for GIF

nothing special yet, trying to work out bugs but want to do a branch