started added basic logging, needs correct placment then finish error control