improve collect_bioisosteres algorithm