add new method to find loop point in an array