Added edit and update functions.