split off animation math into new file