Updated all of the r code again and it works much much better