code to include charged particles