Reowrked everything to work with animationtimer.