Manually implement keep and discard