generate the walls in a separate function