added multiple particle-types support, some bugfixing