I think this is a rebase problem here - I think the ```f.bdx != f.bmdi``` needs to stay throughout.