Added bitmasking for walls.