added some code to bg_checks and some other stuff