add_rev function added to add_rev program but not working