implemented some stuff on analyzing