Added disambiguation logic when more bwb's are found for the reference.

Also runned a "reformat file" in PyCharm (did some auto formatting and optimized imports).