added analytics and some other stuff.