added condLocalMc moved d calculation to outter loop in condLocalGreater