Adding logging instead of puts