Added checkrepos function; needs some cleanup