Improved Logging and fully implemented ancestry check