added rep function