An example front-end code that I wrote.