replaced .get with .remove on the hashmaps.