Code for the Balance-o-matic project