Refactored the raindrop solution