Added sameLength method, reduce time to find sameLength