Adding rep function