Custom js for adding groups and percentages dynamically