moved front end code into a file