Added functionality to the edit details page.
Next step cleaning code and adding comments