Removed prints and replaced with logging calls