buildingrules source code