Implemented replace method on list