1) added logs
2) deleted dead code