Added handling of case when some inputs contain only 0's in difference table. Caused error in while loop condition.