fixed model relationships, added study_id to comparison