encoding and debugging code