added calculation of BAB & CMD/FLAT