Added analytics, fixed bugs