pump logic