reworked everything + added analytics