Implementation of cp