Implemented lowering threshold when too much walls. separated class file.