First changes to rain.c