formatted code and added google analytics