use strtol. atoi is deprecated