added analytics & cleaned up homepage code