Can you reduce this to two loops? One that loops over [0, width) and adds the north/south walls; One that loops over (0, height) and adds the east/west walls?