refactored plasma rendering function, minor tweaks