fixed zero division bug that happened when all given numbers were the same

fixed zero division bug that happened when all given numbers were the same