Added logging
Merged Changes from John May