Rewrote logging