Added outputpath argument