added logic if statement for power operations