added analytics; removed old code