added function for removing 1st loop