Move ratio calculation into a function
Update indices (since index 6 and 7 are now ratios)
Pass ratios in initPublisher and subscribe
Build main js