Added keyboard edit function