bad c solution to rainfall