changed some stuff
fixed the overflow problem