Added code to only submit values that changed, cleaned up controller code