Walls added. IsEmpty function modified