started work on the hail function