Added in logging in functionality