Added total array function and streamlined isPan function
finalized solution to problem 32