I was wondering about Time-dilation in Special Relativity. I am still a middle school student who wonders so please excuse me if I missed any important aspects.
Let us assume we have a system of coordinates where an point $A$ and $B$ which are located upon the walls of an object where $A$ is located in the axis of $(X_1, Y_1)$ and $B$ upon axis of $(X_2, Y_1)$ are stationary and let us assume the time is the time an beam of light takes to reach from $A$ till $B$ and back.
Using the following coordinates given above we can calculate the objects length (no need for width) as being $L = X_2 - X_1$
Using the assumption we can say the ray must travel the distance of $2AB$ in order for an unit of our time to pass or since $AB$ are the line till the start and edge of object the light ray must only travel $2L$ in an stationary system of coordinates (frame of reference).
Now let us incorporate this concept of our "time unit" and apply this to a new system of coordinates where the object is travelling at an velocity $v_0$ in the $X$ axis of our system of coordinates, using the derivations of special relativity of length contraction (Lorentz-Fitzgerald Contraction) we can say the object will begin to contract in the direction of velocity ($X$ axis) with the following factor:
$$L' = \gamma L$$ $$L' = L * (\sqrt{1 - \frac{v^2}{c^2}})$$ $$L' = (X_2 - X_1) * (\sqrt{1 - \frac{v_0{^2}}{c^2}})$$
Using the equation of the time unit I derived for time, we can say now a unit of our time for an observer will be the distance (light will cover) for a unit of time to pass for us (observer):
$$2L'$$ $$2 * ((X_2 - X_1) * (\sqrt{1 - \frac{v_0{^2}}{c^2}})) $$
This clearly shows as the object attain velocity $L'$ gets smaller super-exponentially and from Michelson-Morley experiment we know that $c$ is always constant in all frames of reference and time-frames, now using basic calculations from classical mechanics we can say that light takes less time to cover $L'$ as:
$D = \frac{L}{c}$ will always be bigger than $D' = \frac{L'}{c}$, therefore as solving this further we will get:
$$D = \frac{(2 * (X_2 - X_1))}{c}$$
while $D'$ gives us: $$D' = \frac{(2* ((X_2 - X_1) * (\sqrt{1 - \frac{v_0{^2}}{c^2}})))}{c}$$
so we can say $c$ has to cover less distance in $D'$ as $D' > D$which leads to us as a observer to calculate a quicker time on an moving body on contrary to Einsteins actual time-dilation which shows complete opposite, that shows time slows down as you increase velocity.
Not only has Einstein been proven correct but using logical reasoning I am still confused as I still believe I should be correct yet I am not, why is my reasoning wrong? Am I missing an important factor of Special Relativity that should have been added in this thought experiment? If so what is it? and why is my line of thought incorrect?