Code before switching to CompoundJS