Add code from old version of floorpaint