Moved the task of finding the max contiguous product into its own subroutine