Modified for gif export.