improved headers generation; removed B usage