irefactor some js
restructure a lot of code to calculate daily rain