basic implementation of edit