added code generation to console when pressing buttons