Adding validation rules to update function.
Minor alterations.