Added logging support and removed bare prints.