use strol. atoi is deprecated