Added looping functionality in sequence