added function to calculate nlte levels, not a new code but for some reason never put it on github