Added support for different sizes of X and Y

Previous version wasn't working as expected at all infact
now I'm ensuring that multiplication is only done when
we get to two digits.