Added replaceAt() method