Final work. It appears to be working now, even the counter. I don't know if Dr. Salamy wanted an actual counter or not. The assignment says the circuit only has one output z and then we are told, without context, to count the number of occurences. For the purposes of simulation, we can do this with the signal 'count' that I made and updated appropriately.