updated snow function