removed plot function and arrays