adding tests and final changes to utils.py for membership conversion