added new implementation of the marking rows and columns to 0