make sure 0-row and 0-column corner cases are both handled and not causing additional dependencies