Formatting
edit function in controller. needs testing.