pseudocode for absorbing