toArray update

needs a check on commented code for necessity