An Algorithm for BIB Designs