baf and varw calculation