Having trouble making operation be defined as a local variable