ported core functions from the database searching notebook
updated so important code is printed from iab, rather than implemented directly
updated so important code is printed from iab, rather than implemented directly