The Replica Code