cont'd logic for ripple