fixed segfaults, finalized conversion, tested on 16 brots