Added mines functionality.
Fixed: two small memory and resource inefficiencies.