fixed bug with non-zeroes