determine number steps for animation dynamically