generate the num ops programmatically
move num op generation closer to protocol definition
fix variable name