removed some comments, added some logging