Added log statements instead of print