added basic code to mark invalid cells