started putting logging functions togetehr