Added edit functionality

Addded state moddel