added alittle bit of magic
fixed overflow on mobiles