Adapted bithelper for current revision. Also stylecopped it.