Doesn't work propertly (Sometimes overflow occurs)