adding graph and link params to createArrays function