Changed 6 -ne 5 to 6 -lt 5 before calling idpplot.R