removed some dead code and added some logging