first part of the analytics