reordered functions and renamed gif