bdb optimization
flags check for inf ..