A Monte Carlo simulation of cosmic rays interactions with Earth's atmosphere