edited perform operation function