added logic to take first sample maximum past index 1