use strtol() instead of atoi()