Peter's front-end code