Changing analytics code, fixes #4