added particle class, optimisation to complex