Removed redundant code blocks and replaced with a function

Added a new function, pow_complex which contains the code
corresponding to complex^integer