Finalized script to write home page