Added edit functionality to main form