adds transitions
dynamic js version