Now calculateFrame function is public.