updated stringToInteger to not use the pow function, instead uses magnitude and for loop