Improvements to update logic
Removed print debugging.