Added mapIsWall, some code cleanups