added function to simulate atoi library function.