implemented anaytics, closes #3