Removed duplicated function. DODGY UNTESTED.