Code for building rigs