added codegen for scalar powers