Imroved repository script.