of_n function added