re-factored balance command now works with group and time weights
(cherry picked from commit 3f674e5062aa8533f91da871f36f7bdcd90845db)