modify fill_wall to reduce duplicate codes