Refractored timeline and fixed the layout problem