fixes B sequence check and adds logging ability