added frame_type as an input to the nit function