script for creating main page