How the weather function work?