calculate edits