Code written to create index page properly