Modified Atoi to handle negative integers