added functions for element processing and balancing