added isWall function