Added code generation and clear board functionality