index and length added